var sharkViewer = function(e) {
    var t = {};

    function r(n) {
        if (t[n])
            return t[n].exports;
        var o = t[n] = {
            i: n,
            l: !1,
            exports: {}
        };
        return e[n].call(o.exports, o, o.exports, r),
        o.l = !0,
        o.exports
    }
    return r.m = e,
    r.c = t,
    r.d = function(e, t, n) {
        r.o(e, t) || Object.defineProperty(e, t, {
            enumerable: !0,
            get: n
        })
    }
    ,
    r.r = function(e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
            value: "Module"
        }),
        Object.defineProperty(e, "__esModule", {
            value: !0
        })
    }
    ,
    r.t = function(e, t) {
        if (1 & t && (e = r(e)),
        8 & t)
            return e;
        if (4 & t && "object" == typeof e && e && e.__esModule)
            return e;
        var n = Object.create(null);
        if (r.r(n),
        Object.defineProperty(n, "default", {
            enumerable: !0,
            value: e
        }),
        2 & t && "string" != typeof e)
            for (var o in e)
                r.d(n, o, function(t) {
                    return e[t]
                }
                .bind(null, o));
        return n
    }
    ,
    r.n = function(e) {
        var t = e && e.__esModule ? function() {
            return e.default
        }
        : function() {
            return e
        }
        ;
        return r.d(t, "a", t),
        t
    }
    ,
    r.o = function(e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }
    ,
    r.p = "",
    r(r.s = 71)
}([function(e, t, r) {
    (function(t) {
        var r = function(e) {
            return e && e.Math == Math && e
        };
        e.exports = r("object" == typeof globalThis && globalThis) || r("object" == typeof window && window) || r("object" == typeof self && self) || r("object" == typeof t && t) || function() {
            return this
        }() || Function("return this")()
    }
    ).call(this, r(43))
}
, function(e, t, r) {
    var n = r(24)
      , o = {}.hasOwnProperty;
    e.exports = Object.hasOwn || function(e, t) {
        return o.call(n(e), t)
    }
}
, function(e, t) {
    e.exports = function(e) {
        try {
            return !!e()
        } catch (e) {
            return !0
        }
    }
}
, function(e, t, r) {
    var n = r(4)
      , o = r(6)
      , i = r(10);
    e.exports = n ? function(e, t, r) {
        return o.f(e, t, i(1, r))
    }
    : function(e, t, r) {
        return e[t] = r,
        e
    }
}
, function(e, t, r) {
    var n = r(2);
    e.exports = !n((function() {
        return 7 != Object.defineProperty({}, 1, {
            get: function() {
                return 7
            }
        })[1]
    }
    ))
}
, function(e, t) {
    e.exports = function(e) {
        return "object" == typeof e ? null !== e : "function" == typeof e
    }
}
, function(e, t, r) {
    var n = r(4)
      , o = r(25)
      , i = r(7)
      , a = r(23)
      , s = Object.defineProperty;
    t.f = n ? s : function(e, t, r) {
        if (i(e),
        t = a(t, !0),
        i(r),
        o)
            try {
                return s(e, t, r)
            } catch (e) {}
        if ("get"in r || "set"in r)
            throw TypeError("Accessors not supported");
        return "value"in r && (e[t] = r.value),
        e
    }
}
, function(e, t, r) {
    var n = r(5);
    e.exports = function(e) {
        if (!n(e))
            throw TypeError(String(e) + " is not an object");
        return e
    }
}
, function(e, t, r) {
    var n = r(0)
      , o = r(30)
      , i = r(1)
      , a = r(31)
      , s = r(35)
      , c = r(62)
      , u = o("wks")
      , l = n.Symbol
      , h = c ? l : l && l.withoutSetter || a;
    e.exports = function(e) {
        return i(u, e) && (s || "string" == typeof u[e]) || (s && i(l, e) ? u[e] = l[e] : u[e] = h("Symbol." + e)),
        u[e]
    }
}
, function(e, t, r) {
    var n = r(45)
      , o = r(22);
    e.exports = function(e) {
        return n(o(e))
    }
}
, function(e, t) {
    e.exports = function(e, t) {
        return {
            enumerable: !(1 & e),
            configurable: !(2 & e),
            writable: !(4 & e),
            value: t
        }
    }
}
, function(e, t, r) {
    var n = r(0)
      , o = r(3);
    e.exports = function(e, t) {
        try {
            o(n, e, t)
        } catch (r) {
            n[e] = t
        }
        return t
    }
}
, function(e, t, r) {
    var n = r(0)
      , o = r(11)
      , i = n["__core-js_shared__"] || o("__core-js_shared__", {});
    e.exports = i
}
, function(e, t, r) {
    var n = r(30)
      , o = r(31)
      , i = n("keys");
    e.exports = function(e) {
        return i[e] || (i[e] = o(e))
    }
}
, function(e, t) {
    e.exports = !1
}
, function(e, t) {
    e.exports = {}
}
, function(e, t, r) {
    var n = r(49)
      , o = r(0)
      , i = function(e) {
        return "function" == typeof e ? e : void 0
    };
    e.exports = function(e, t) {
        return arguments.length < 2 ? i(n[e]) || i(o[e]) : n[e] && n[e][t] || o[e] && o[e][t]
    }
}
, function(e, t) {
    e.exports = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
}
, function(e, t) {
    e.exports = {}
}
, function(e, t) {
    e.exports = THREE
}
, function(e, t, r) {
    var n = r(0)
      , o = r(21).f
      , i = r(3)
      , a = r(27)
      , s = r(11)
      , c = r(32)
      , u = r(55);
    e.exports = function(e, t) {
        var r, l, h, p, f, d = e.target, v = e.global, m = e.stat;
        if (r = v ? n : m ? n[d] || s(d, {}) : (n[d] || {}).prototype)
            for (l in t) {
                if (p = t[l],
                h = e.noTargetGet ? (f = o(r, l)) && f.value : r[l],
                !u(v ? l : d + (m ? "." : "#") + l, e.forced) && void 0 !== h) {
                    if (typeof p == typeof h)
                        continue;
                    c(p, h)
                }
                (e.sham || h && h.sham) && i(p, "sham", !0),
                a(r, l, p, e)
            }
    }
}
, function(e, t, r) {
    var n = r(4)
      , o = r(44)
      , i = r(10)
      , a = r(9)
      , s = r(23)
      , c = r(1)
      , u = r(25)
      , l = Object.getOwnPropertyDescriptor;
    t.f = n ? l : function(e, t) {
        if (e = a(e),
        t = s(t, !0),
        u)
            try {
                return l(e, t)
            } catch (e) {}
        if (c(e, t))
            return i(!o.f.call(e, t), e[t])
    }
}
, function(e, t) {
    e.exports = function(e) {
        if (null == e)
            throw TypeError("Can't call method on " + e);
        return e
    }
}
, function(e, t, r) {
    var n = r(5);
    e.exports = function(e, t) {
        if (!n(e))
            return e;
        var r, o;
        if (t && "function" == typeof (r = e.toString) && !n(o = r.call(e)))
            return o;
        if ("function" == typeof (r = e.valueOf) && !n(o = r.call(e)))
            return o;
        if (!t && "function" == typeof (r = e.toString) && !n(o = r.call(e)))
            return o;
        throw TypeError("Can't convert object to primitive value")
    }
}
, function(e, t, r) {
    var n = r(22);
    e.exports = function(e) {
        return Object(n(e))
    }
}
, function(e, t, r) {
    var n = r(4)
      , o = r(2)
      , i = r(26);
    e.exports = !n && !o((function() {
        return 7 != Object.defineProperty(i("div"), "a", {
            get: function() {
                return 7
            }
        }).a
    }
    ))
}
, function(e, t, r) {
    var n = r(0)
      , o = r(5)
      , i = n.document
      , a = o(i) && o(i.createElement);
    e.exports = function(e) {
        return a ? i.createElement(e) : {}
    }
}
, function(e, t, r) {
    var n = r(0)
      , o = r(3)
      , i = r(1)
      , a = r(11)
      , s = r(28)
      , c = r(29)
      , u = c.get
      , l = c.enforce
      , h = String(String).split("String");
    (e.exports = function(e, t, r, s) {
        var c, u = !!s && !!s.unsafe, p = !!s && !!s.enumerable, f = !!s && !!s.noTargetGet;
        "function" == typeof r && ("string" != typeof t || i(r, "name") || o(r, "name", t),
        (c = l(r)).source || (c.source = h.join("string" == typeof t ? t : ""))),
        e !== n ? (u ? !f && e[t] && (p = !0) : delete e[t],
        p ? e[t] = r : o(e, t, r)) : p ? e[t] = r : a(t, r)
    }
    )(Function.prototype, "toString", (function() {
        return "function" == typeof this && u(this).source || s(this)
    }
    ))
}
, function(e, t, r) {
    var n = r(12)
      , o = Function.toString;
    "function" != typeof n.inspectSource && (n.inspectSource = function(e) {
        return o.call(e)
    }
    ),
    e.exports = n.inspectSource
}
, function(e, t, r) {
    var n, o, i, a = r(47), s = r(0), c = r(5), u = r(3), l = r(1), h = r(12), p = r(13), f = r(15), d = s.WeakMap;
    if (a || h.state) {
        var v = h.state || (h.state = new d)
          , m = v.get
          , y = v.has
          , g = v.set;
        n = function(e, t) {
            if (y.call(v, e))
                throw new TypeError("Object already initialized");
            return t.facade = e,
            g.call(v, e, t),
            t
        }
        ,
        o = function(e) {
            return m.call(v, e) || {}
        }
        ,
        i = function(e) {
            return y.call(v, e)
        }
    } else {
        var x = p("state");
        f[x] = !0,
        n = function(e, t) {
            if (l(e, x))
                throw new TypeError("Object already initialized");
            return t.facade = e,
            u(e, x, t),
            t
        }
        ,
        o = function(e) {
            return l(e, x) ? e[x] : {}
        }
        ,
        i = function(e) {
            return l(e, x)
        }
    }
    e.exports = {
        set: n,
        get: o,
        has: i,
        enforce: function(e) {
            return i(e) ? o(e) : n(e, {})
        },
        getterFor: function(e) {
            return function(t) {
                var r;
                if (!c(t) || (r = o(t)).type !== e)
                    throw TypeError("Incompatible receiver, " + e + " required");
                return r
            }
        }
    }
}
, function(e, t, r) {
    var n = r(14)
      , o = r(12);
    (e.exports = function(e, t) {
        return o[e] || (o[e] = void 0 !== t ? t : {})
    }
    )("versions", []).push({
        version: "3.13.1",
        mode: n ? "pure" : "global",
        copyright: "© 2021 Denis Pushkarev (zloirock.ru)"
    })
}
, function(e, t) {
    var r = 0
      , n = Math.random();
    e.exports = function(e) {
        return "Symbol(" + String(void 0 === e ? "" : e) + ")_" + (++r + n).toString(36)
    }
}
, function(e, t, r) {
    var n = r(1)
      , o = r(48)
      , i = r(21)
      , a = r(6);
    e.exports = function(e, t) {
        for (var r = o(t), s = a.f, c = i.f, u = 0; u < r.length; u++) {
            var l = r[u];
            n(e, l) || s(e, l, c(t, l))
        }
    }
}
, function(e, t, r) {
    var n = r(1)
      , o = r(9)
      , i = r(51).indexOf
      , a = r(15);
    e.exports = function(e, t) {
        var r, s = o(e), c = 0, u = [];
        for (r in s)
            !n(a, r) && n(s, r) && u.push(r);
        for (; t.length > c; )
            n(s, r = t[c++]) && (~i(u, r) || u.push(r));
        return u
    }
}
, function(e, t) {
    var r = Math.ceil
      , n = Math.floor;
    e.exports = function(e) {
        return isNaN(e = +e) ? 0 : (e > 0 ? n : r)(e)
    }
}
, function(e, t, r) {
    var n = r(60)
      , o = r(2);
    e.exports = !!Object.getOwnPropertySymbols && !o((function() {
        var e = Symbol();
        return !String(e) || !(Object(e)instanceof Symbol) || !Symbol.sham && n && n < 41
    }
    ))
}
, function(e, t, r) {
    var n, o = r(7), i = r(63), a = r(17), s = r(15), c = r(65), u = r(26), l = r(13), h = l("IE_PROTO"), p = function() {}, f = function(e) {
        return "<script>" + e + "<\/script>"
    }, d = function() {
        try {
            n = document.domain && new ActiveXObject("htmlfile")
        } catch (e) {}
        var e, t;
        d = n ? function(e) {
            e.write(f("")),
            e.close();
            var t = e.parentWindow.Object;
            return e = null,
            t
        }(n) : ((t = u("iframe")).style.display = "none",
        c.appendChild(t),
        t.src = String("javascript:"),
        (e = t.contentWindow.document).open(),
        e.write(f("document.F=Object")),
        e.close(),
        e.F);
        for (var r = a.length; r--; )
            delete d.prototype[a[r]];
        return d()
    };
    s[h] = !0,
    e.exports = Object.create || function(e, t) {
        var r;
        return null !== e ? (p.prototype = o(e),
        r = new p,
        p.prototype = null,
        r[h] = e) : r = d(),
        void 0 === t ? r : i(r, t)
    }
}
, function(e, t, r) {
    "use strict";
    var n, o, i, a = r(2), s = r(38), c = r(3), u = r(1), l = r(8), h = r(14), p = l("iterator"), f = !1;
    [].keys && ("next"in (i = [].keys()) ? (o = s(s(i))) !== Object.prototype && (n = o) : f = !0);
    var d = null == n || a((function() {
        var e = {};
        return n[p].call(e) !== e
    }
    ));
    d && (n = {}),
    h && !d || u(n, p) || c(n, p, (function() {
        return this
    }
    )),
    e.exports = {
        IteratorPrototype: n,
        BUGGY_SAFARI_ITERATORS: f
    }
}
, function(e, t, r) {
    var n = r(1)
      , o = r(24)
      , i = r(13)
      , a = r(68)
      , s = i("IE_PROTO")
      , c = Object.prototype;
    e.exports = a ? Object.getPrototypeOf : function(e) {
        return e = o(e),
        n(e, s) ? e[s] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? c : null
    }
}
, function(e, t, r) {
    var n = r(6).f
      , o = r(1)
      , i = r(8)("toStringTag");
    e.exports = function(e, t, r) {
        e && !o(e = r ? e : e.prototype, i) && n(e, i, {
            configurable: !0,
            value: t
        })
    }
}
, function(e, t, r) {
    "use strict";

    function n(e) {
        throw new Error(e)
    }
    e.exports = function(e) {
        e.OBJLoader = function(t) {
            this.manager = void 0 !== t ? t : e.DefaultLoadingManager,
            this.materials = null,
            this.regexp = {
                vertex_pattern: /^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
                normal_pattern: /^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
                uv_pattern: /^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,
                face_vertex: /^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,
                face_vertex_uv: /^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,
                face_vertex_uv_normal: /^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,
                face_vertex_normal: /^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,
                object_pattern: /^[og]\s*(.+)?/,
                smoothing_pattern: /^s\s+(\d+|on|off)/,
                material_library_pattern: /^mtllib /,
                material_use_pattern: /^usemtl /
            }
        }
        ,
        e.OBJLoader.prototype = {
            constructor: e.OBJLoader,
            load: function(t, r, o, i) {
                var a = this;
                this.onError = i || n;
                var s = new e.FileLoader(a.manager);
                s.setPath(this.path),
                s.load(t, (function(e) {
                    r(a.parse(e))
                }
                ), o, i)
            },
            setPath: function(e) {
                this.path = e
            },
            setMaterials: function(e) {
                this.materials = e
            },
            _createParserState: function() {
                var e = {
                    objects: [],
                    object: {},
                    vertices: [],
                    normals: [],
                    uvs: [],
                    materialLibraries: [],
                    startObject: function(e, t) {
                        if (this.object && !1 === this.object.fromDeclaration)
                            return this.object.name = e,
                            void (this.object.fromDeclaration = !1 !== t);
                        var r = this.object && "function" == typeof this.object.currentMaterial ? this.object.currentMaterial() : void 0;
                        if (this.object && "function" == typeof this.object._finalize && this.object._finalize(!0),
                        this.object = {
                            name: e || "",
                            fromDeclaration: !1 !== t,
                            geometry: {
                                vertices: [],
                                normals: [],
                                uvs: []
                            },
                            materials: [],
                            smooth: !0,
                            startMaterial: function(e, t) {
                                var r = this._finalize(!1);
                                r && (r.inherited || r.groupCount <= 0) && this.materials.splice(r.index, 1);
                                var n = {
                                    index: this.materials.length,
                                    name: e || "",
                                    mtllib: Array.isArray(t) && t.length > 0 ? t[t.length - 1] : "",
                                    smooth: void 0 !== r ? r.smooth : this.smooth,
                                    groupStart: void 0 !== r ? r.groupEnd : 0,
                                    groupEnd: -1,
                                    groupCount: -1,
                                    inherited: !1,
                                    clone: function(e) {
                                        var t = {
                                            index: "number" == typeof e ? e : this.index,
                                            name: this.name,
                                            mtllib: this.mtllib,
                                            smooth: this.smooth,
                                            groupStart: 0,
                                            groupEnd: -1,
                                            groupCount: -1,
                                            inherited: !1
                                        };
                                        return t.clone = this.clone.bind(t),
                                        t
                                    }
                                };
                                return this.materials.push(n),
                                n
                            },
                            currentMaterial: function() {
                                if (this.materials.length > 0)
                                    return this.materials[this.materials.length - 1]
                            },
                            _finalize: function(e) {
                                var t = this.currentMaterial();
                                if (t && -1 === t.groupEnd && (t.groupEnd = this.geometry.vertices.length / 3,
                                t.groupCount = t.groupEnd - t.groupStart,
                                t.inherited = !1),
                                e && this.materials.length > 1)
                                    for (var r = this.materials.length - 1; r >= 0; r--)
                                        this.materials[r].groupCount <= 0 && this.materials.splice(r, 1);
                                return e && 0 === this.materials.length && this.materials.push({
                                    name: "",
                                    smooth: this.smooth
                                }),
                                t
                            }
                        },
                        r && r.name && "function" == typeof r.clone) {
                            var n = r.clone(0);
                            n.inherited = !0,
                            this.object.materials.push(n)
                        }
                        this.objects.push(this.object)
                    },
                    finalize: function() {
                        this.object && "function" == typeof this.object._finalize && this.object._finalize(!0)
                    },
                    parseVertexIndex: function(e, t) {
                        var r = parseInt(e, 10);
                        return 3 * (r >= 0 ? r - 1 : r + t / 3)
                    },
                    parseNormalIndex: function(e, t) {
                        var r = parseInt(e, 10);
                        return 3 * (r >= 0 ? r - 1 : r + t / 3)
                    },
                    parseUVIndex: function(e, t) {
                        var r = parseInt(e, 10);
                        return 2 * (r >= 0 ? r - 1 : r + t / 2)
                    },
                    addVertex: function(e, t, r) {
                        var n = this.vertices
                          , o = this.object.geometry.vertices;
                        o.push(n[e + 0]),
                        o.push(n[e + 1]),
                        o.push(n[e + 2]),
                        o.push(n[t + 0]),
                        o.push(n[t + 1]),
                        o.push(n[t + 2]),
                        o.push(n[r + 0]),
                        o.push(n[r + 1]),
                        o.push(n[r + 2])
                    },
                    addVertexLine: function(e) {
                        var t = this.vertices
                          , r = this.object.geometry.vertices;
                        r.push(t[e + 0]),
                        r.push(t[e + 1]),
                        r.push(t[e + 2])
                    },
                    addNormal: function(e, t, r) {
                        var n = this.normals
                          , o = this.object.geometry.normals;
                        o.push(n[e + 0]),
                        o.push(n[e + 1]),
                        o.push(n[e + 2]),
                        o.push(n[t + 0]),
                        o.push(n[t + 1]),
                        o.push(n[t + 2]),
                        o.push(n[r + 0]),
                        o.push(n[r + 1]),
                        o.push(n[r + 2])
                    },
                    addUV: function(e, t, r) {
                        var n = this.uvs
                          , o = this.object.geometry.uvs;
                        o.push(n[e + 0]),
                        o.push(n[e + 1]),
                        o.push(n[t + 0]),
                        o.push(n[t + 1]),
                        o.push(n[r + 0]),
                        o.push(n[r + 1])
                    },
                    addUVLine: function(e) {
                        var t = this.uvs
                          , r = this.object.geometry.uvs;
                        r.push(t[e + 0]),
                        r.push(t[e + 1])
                    },
                    addFace: function(e, t, r, n, o, i, a, s, c, u, l, h) {
                        var p, f = this.vertices.length, d = this.parseVertexIndex(e, f), v = this.parseVertexIndex(t, f), m = this.parseVertexIndex(r, f);
                        if (void 0 === n ? this.addVertex(d, v, m) : (p = this.parseVertexIndex(n, f),
                        this.addVertex(d, v, p),
                        this.addVertex(v, m, p)),
                        void 0 !== o) {
                            var y = this.uvs.length;
                            d = this.parseUVIndex(o, y),
                            v = this.parseUVIndex(i, y),
                            m = this.parseUVIndex(a, y),
                            void 0 === n ? this.addUV(d, v, m) : (p = this.parseUVIndex(s, y),
                            this.addUV(d, v, p),
                            this.addUV(v, m, p))
                        }
                        if (void 0 !== c) {
                            var g = this.normals.length;
                            d = this.parseNormalIndex(c, g),
                            v = c === u ? d : this.parseNormalIndex(u, g),
                            m = c === l ? d : this.parseNormalIndex(l, g),
                            void 0 === n ? this.addNormal(d, v, m) : (p = this.parseNormalIndex(h, g),
                            this.addNormal(d, v, p),
                            this.addNormal(v, m, p))
                        }
                    },
                    addLineGeometry: function(e, t) {
                        this.object.geometry.type = "Line";
                        for (var r = this.vertices.length, n = this.uvs.length, o = 0, i = e.length; o < i; o++)
                            this.addVertexLine(this.parseVertexIndex(e[o], r));
                        var a = 0;
                        for (i = t.length; a < i; a++)
                            this.addUVLine(this.parseUVIndex(t[a], n))
                    }
                };
                return e.startObject("", !1),
                e
            },
            parse: function(t, r) {
                void 0 === r && (r = !0),
                r && console.time("OBJLoader");
                var n = this._createParserState();
                -1 !== t.indexOf("\r\n") && (t = t.replace(/\r\n/g, "\n")),
                -1 !== t.indexOf("\\\n") && (t = t.replace(/\\\n/g, ""));
                for (var o = t.split("\n"), i = "", a = "", s = "", c = [], u = "function" == typeof "".trimLeft, l = 0, h = o.length; l < h; l++)
                    if (i = o[l],
                    0 !== (i = u ? i.trimLeft() : i.trim()).length && "#" !== (a = i.charAt(0)))
                        if ("v" === a)
                            " " === (s = i.charAt(1)) && null !== (c = this.regexp.vertex_pattern.exec(i)) ? n.vertices.push(parseFloat(c[1]), parseFloat(c[2]), parseFloat(c[3])) : "n" === s && null !== (c = this.regexp.normal_pattern.exec(i)) ? n.normals.push(parseFloat(c[1]), parseFloat(c[2]), parseFloat(c[3])) : "t" === s && null !== (c = this.regexp.uv_pattern.exec(i)) ? n.uvs.push(parseFloat(c[1]), parseFloat(c[2])) : this.onError("Unexpected vertex/normal/uv line: '" + i + "'");
                        else if ("f" === a)
                            null !== (c = this.regexp.face_vertex_uv_normal.exec(i)) ? n.addFace(c[1], c[4], c[7], c[10], c[2], c[5], c[8], c[11], c[3], c[6], c[9], c[12]) : null !== (c = this.regexp.face_vertex_uv.exec(i)) ? n.addFace(c[1], c[3], c[5], c[7], c[2], c[4], c[6], c[8]) : null !== (c = this.regexp.face_vertex_normal.exec(i)) ? n.addFace(c[1], c[3], c[5], c[7], void 0, void 0, void 0, void 0, c[2], c[4], c[6], c[8]) : null !== (c = this.regexp.face_vertex.exec(i)) ? n.addFace(c[1], c[2], c[3], c[4]) : this.onError("Unexpected face line: '" + i + "'");
                        else if ("l" === a) {
                            var p = i.substring(1).trim().split(" ")
                              , f = []
                              , d = [];
                            if (-1 === i.indexOf("/"))
                                f = p;
                            else
                                for (var v = 0, m = p.length; v < m; v++) {
                                    var y = p[v].split("/");
                                    "" !== y[0] && f.push(y[0]),
                                    "" !== y[1] && d.push(y[1])
                                }
                            n.addLineGeometry(f, d)
                        } else if (null !== (c = this.regexp.object_pattern.exec(i))) {
                            var g = (" " + c[0].substr(1).trim()).substr(1);
                            n.startObject(g)
                        } else if (this.regexp.material_use_pattern.test(i))
                            n.object.startMaterial(i.substring(7).trim(), n.materialLibraries);
                        else if (this.regexp.material_library_pattern.test(i))
                            n.materialLibraries.push(i.substring(7).trim());
                        else if (null !== (c = this.regexp.smoothing_pattern.exec(i))) {
                            var x = c[1].trim().toLowerCase();
                            n.object.smooth = "1" === x || "on" === x,
                            (P = n.object.currentMaterial()) && (P.smooth = n.object.smooth)
                        } else {
                            if ("\0" === i)
                                continue;
                            this.onError("Unexpected line: '" + i + "'")
                        }
                n.finalize();
                var b = new e.Group;
                b.materialLibraries = [].concat(n.materialLibraries);
                for (l = 0,
                h = n.objects.length; l < h; l++) {
                    var w = n.objects[l]
                      , C = w.geometry
                      , A = w.materials
                      , S = "Line" === C.type;
                    if (0 !== C.vertices.length) {
                        var j = new e.BufferGeometry;
                        j.addAttribute("position", new e.BufferAttribute(new Float32Array(C.vertices),3)),
                        C.normals.length > 0 ? j.addAttribute("normal", new e.BufferAttribute(new Float32Array(C.normals),3)) : j.computeVertexNormals(),
                        C.uvs.length > 0 && j.addAttribute("uv", new e.BufferAttribute(new Float32Array(C.uvs),2));
                        for (var M, O = [], z = 0, L = A.length; z < L; z++) {
                            var F = A[z]
                              , P = void 0;
                            if (null !== this.materials && (P = this.materials.create(F.name),
                            S && P && !(P instanceof e.LineBasicMaterial))) {
                                var D = new e.LineBasicMaterial;
                                D.copy(P),
                                P = D
                            }
                            P || ((P = S ? new e.LineBasicMaterial : new e.MeshPhongMaterial).name = F.name),
                            P.shading = F.smooth ? e.SmoothShading : e.FlatShading,
                            O.push(P)
                        }
                        if (O.length > 1) {
                            for (z = 0,
                            L = A.length; z < L; z++) {
                                F = A[z];
                                j.addGroup(F.groupStart, F.groupCount, z)
                            }
                            var E = new e.MultiMaterial(O);
                            M = S ? new e.LineSegments(j,E) : new e.Mesh(j,E)
                        } else
                            M = S ? new e.LineSegments(j,O[0]) : new e.Mesh(j,O[0]);
                        M.name = w.name,
                        b.add(M)
                    }
                }
                return r && console.timeEnd("OBJLoader"),
                b
            }
        }
    }
}
, function(e, t, r) {
    "use strict";

    function n(e) {
        return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
            return typeof e
        }
        : function(e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        }
        )(e)
    }
    Object.defineProperty(t, "__esModule", {
        value: !0
    }),
    t.default = void 0,
    r(42),
    r(56);
    var o = function(e, t) {
        if (!t && e && e.__esModule)
            return e;
        if (null === e || "object" !== n(e) && "function" != typeof e)
            return {
                default: e
            };
        var r = i(t);
        if (r && r.has(e))
            return r.get(e);
        var o = {}
          , a = Object.defineProperty && Object.getOwnPropertyDescriptor;
        for (var s in e)
            if ("default" !== s && Object.prototype.hasOwnProperty.call(e, s)) {
                var c = a ? Object.getOwnPropertyDescriptor(e, s) : null;
                c && (c.get || c.set) ? Object.defineProperty(o, s, c) : o[s] = e[s]
            }
        o.default = e,
        r && r.set(e, o);
        return o
    }(r(19));

    function i(e) {
        if ("function" != typeof WeakMap)
            return null;
        var t = new WeakMap
          , r = new WeakMap;
        return (i = function(e) {
            return e ? r : t
        }
        )(e)
    }

    function a(e, t) {
        return (a = Object.setPrototypeOf || function(e, t) {
            return e.__proto__ = t,
            e
        }
        )(e, t)
    }

    function s(e) {
        var t = function() {
            if ("undefined" == typeof Reflect || !Reflect.construct)
                return !1;
            if (Reflect.construct.sham)
                return !1;
            if ("function" == typeof Proxy)
                return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}
                ))),
                !0
            } catch (e) {
                return !1
            }
        }();
        return function() {
            var r, n = l(e);
            if (t) {
                var o = l(this).constructor;
                r = Reflect.construct(n, arguments, o)
            } else
                r = n.apply(this, arguments);
            return c(this, r)
        }
    }

    function c(e, t) {
        return !t || "object" !== n(t) && "function" != typeof t ? u(e) : t
    }

    function u(e) {
        if (void 0 === e)
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e
    }

    function l(e) {
        return (l = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        }
        )(e)
    }

    function h(e, t, r) {
        return t in e ? Object.defineProperty(e, t, {
            value: r,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[t] = r,
        e
    }
    var p = Object.freeze({
        INACTIVE: Symbol("INACTIVE"),
        INDETERMINATE: Symbol("INDETERMINATE"),
        ROTATING: Symbol("ROTATING"),
        DOLLYING: Symbol("DOLLYING"),
        PANNING: Symbol("PANNING")
    })
      , f = function(e) {
        !function(e, t) {
            if ("function" != typeof t && null !== t)
                throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e,
                    writable: !0,
                    configurable: !0
                }
            }),
            t && a(e, t)
        }(r, e);
        var t = s(r);

        function r(e, n) {
            var i;
            return function(e, t) {
                if (!(e instanceof t))
                    throw new TypeError("Cannot call a class as a function")
            }(this, r),
            h(u(i = t.call(this)), "reset", (function() {
                i.target.copy(i.target0),
                i.object.position.copy(i.position0),
                i.update()
            }
            )),
            h(u(i), "update", (function() {
                i.object.lookAt(i.target),
                i.state !== p.ROTATING && i.fixUp(),
                i.dispatchEvent(i.changeEvent)
            }
            )),
            h(u(i), "onMouseDown", (function(e) {
                i.state = p.INDETERMINATE,
                i.prev = new o.Vector2(e.clientX,e.clientY),
                e.preventDefault(),
                i.domElement.focus ? i.domElement.focus() : window.focus(),
                document.addEventListener("mousemove", i.onMouseMove, !1),
                document.addEventListener("mouseup", i.onMouseUp, !1),
                i.domElement.addEventListener("contextmenu", i.onContextMenu, !1)
            }
            )),
            h(u(i), "onMouseWheel", (function(e) {
                e.preventDefault(),
                i.state = p.DOLLYING,
                i.prev = new o.Vector2(0,0),
                i.dolly(0, -e.deltaY)
            }
            )),
            h(u(i), "onMouseMove", (function(e) {
                switch (e.preventDefault(),
                e.buttons) {
                case 1:
                    e.altKey ? i.pan(e.clientX, e.clientY) : i.rotate(e.clientX, e.clientY);
                    break;
                case 2:
                    i.pan(e.clientX, e.clientY);
                    break;
                case 4:
                    i.dolly(e.clientX, e.clientY)
                }
            }
            )),
            h(u(i), "onMouseUp", (function() {
                i.state === p.ROTATING && i.fixUp(),
                i.clicked = i.state === p.INDETERMINATE,
                i.state = p.INACTIVE,
                document.removeEventListener("mousemove", i.onMouseMove, !1),
                document.removeEventListener("mouseup", i.onMouseUp, !1),
                i.domElement.removeEventListener("contextmenu", i.onContextMenu, !1)
            }
            )),
            h(u(i), "onKeyDown", (function(e) {
                var t, r, n = !1;
                switch (e.keyCode) {
                case i.keys.UP:
                    n = !0;
                    var a = [0, i.keyPanSpeed];
                    t = a[0],
                    r = a[1];
                    break;
                case i.keys.DOWN:
                    n = !0,
                    t = 0,
                    r = -i.keyPanSpeed;
                    break;
                case i.keys.LEFT:
                    n = !0;
                    var s = [i.keyPanSpeed, 0];
                    t = s[0],
                    r = s[1];
                    break;
                case i.keys.RIGHT:
                    n = !0,
                    t = -i.keyPanSpeed,
                    r = 0
                }
                n && (e.preventDefault(),
                i.state = p.PANNING,
                i.prev = new o.Vector2(0,0),
                i.pan(t, r))
            }
            )),
            h(u(i), "onContextMenu", (function(e) {
                e.preventDefault()
            }
            )),
            h(u(i), "rotate", (function(e, t) {
                var r = new o.Vector2(e,t);
                if (i.state === p.INDETERMINATE && r.manhattanDistanceTo(i.prev) > 2) {
                    i.state = p.ROTATING;
                    var n = (new o.Vector3).subVectors(i.object.position, i.target);
                    i.radius = n.length(),
                    n.divideScalar(i.radius);
                    var a = i.object.up
                      , s = (new o.Vector3).crossVectors(a, n).normalize();
                    i.basisMatrix = (new o.Matrix4).makeBasis(s, a, n);
                    var c = (new o.Matrix4).makeTranslation(i.target.x, i.target.y, i.target.z);
                    i.basisMatrix.premultiply(c)
                }
                if (i.state === p.ROTATING) {
                    var u = (new o.Vector2).subVectors(r, i.prev)
                      , l = 2 * i.rotateSpeed;
                    u.multiplyScalar(l);
                    var h = -u.x * (Math.PI / i.domElement.clientWidth)
                      , f = -u.y * (Math.PI / i.domElement.clientHeight) + Math.PI / 2;
                    f = Math.max(f, .01),
                    f = Math.min(f, Math.PI - .01);
                    var d = new o.Vector3;
                    d.z = i.radius * Math.sin(f) * Math.cos(h),
                    d.x = i.radius * Math.sin(f) * Math.sin(h),
                    d.y = i.radius * Math.cos(f),
                    d.applyMatrix4(i.basisMatrix),
                    i.object.position.copy(d),
                    i.update()
                }
            }
            )),
            h(u(i), "dolly", (function(e, t) {
                var r = new o.Vector2(e,t);
                i.state === p.INDETERMINATE && (r.manhattanDistanceTo(i.prev) > 2 && (i.state = p.DOLLYING));
                if (i.state === p.DOLLYING) {
                    var n = (new o.Vector3).subVectors(i.target, i.object.position)
                      , a = n.length()
                      , s = 2 * a
                      , c = Math.min(i.maxDistance - i.minDistance, s) / i.domElement.clientHeight
                      , u = i.zoomSpeed * c * (i.prev.y - t);
                    if (i.minDistance <= a + u && a + u <= i.maxDistance) {
                        var l = n.multiplyScalar(u / a);
                        i.object.position.sub(l),
                        i.update(),
                        i.prev = r
                    }
                }
            }
            )),
            h(u(i), "pan", (function(e, t) {
                var r = new o.Vector2(e,t);
                i.state === p.INDETERMINATE && (r.manhattanDistanceTo(i.prev) > 2 && (i.state = p.PANNING));
                if (i.state === p.PANNING) {
                    var n = (new o.Vector3).subVectors(i.target, i.object.position)
                      , a = n.length();
                    n.divideScalar(a);
                    var s = i.object.up.clone()
                      , c = (new o.Vector3).crossVectors(s, n).normalize()
                      , u = Math.tan(i.object.fov / 2 * (Math.PI / 360)) * a / (i.domElement.clientHeight / 2)
                      , l = (new o.Vector2).subVectors(r, i.prev)
                      , h = c.multiplyScalar(l.x * u)
                      , f = s.multiplyScalar(l.y * u);
                    i.object.position.add(h),
                    i.object.position.add(f);
                    var d = n.multiplyScalar(a)
                      , v = (new o.Vector3).addVectors(i.object.position, d);
                    i.target = v,
                    i.update(),
                    i.prev = r
                }
            }
            )),
            h(u(i), "fixUp", (function() {
                var e = (new o.Vector3).subVectors(i.target, i.object.position).normalize()
                  , t = (new o.Vector3).crossVectors(e, i.object.up).normalize()
                  , r = (new o.Vector3).crossVectors(t, e).normalize();
                i.object.up.copy(r)
            }
            )),
            i.object = e,
            i.domElement = n,
            i.keyPanSpeed = 7,
            i.keys = {
                LEFT: 37,
                UP: 38,
                RIGHT: 39,
                DOWN: 40
            },
            i.maxDistance = 1 / 0,
            i.minDistance = 0,
            i.rotateSpeed = 1,
            i.target = new o.Vector3,
            i.zoomSpeed = 1,
            i.clicked = !1,
            i.state = p.INACTIVE,
            i.changeEvent = {
                type: "change"
            },
            i.domElement.addEventListener("mousedown", i.onMouseDown, !1),
            i.domElement.addEventListener("wheel", i.onMouseWheel, !1),
            i.domElement.addEventListener("keydown", i.onKeyDown, !1),
            -1 === i.domElement.tabIndex && (i.domElement.tabIndex = 0),
            i.target0 = i.target.clone(),
            i.position0 = i.object.position.clone(),
            i.update(),
            i
        }
        return r
    }(o.EventDispatcher);
    t.default = f
}
, function(e, t, r) {
    "use strict";
    var n = r(20)
      , o = r(4)
      , i = r(0)
      , a = r(1)
      , s = r(5)
      , c = r(6).f
      , u = r(32)
      , l = i.Symbol;
    if (o && "function" == typeof l && (!("description"in l.prototype) || void 0 !== l().description)) {
        var h = {}
          , p = function() {
            var e = arguments.length < 1 || void 0 === arguments[0] ? void 0 : String(arguments[0])
              , t = this instanceof p ? new l(e) : void 0 === e ? l() : l(e);
            return "" === e && (h[t] = !0),
            t
        };
        u(p, l);
        var f = p.prototype = l.prototype;
        f.constructor = p;
        var d = f.toString
          , v = "Symbol(test)" == String(l("test"))
          , m = /^Symbol\((.*)\)[^)]+$/;
        c(f, "description", {
            configurable: !0,
            get: function() {
                var e = s(this) ? this.valueOf() : this
                  , t = d.call(e);
                if (a(h, e))
                    return "";
                var r = v ? t.slice(7, -1) : t.replace(m, "$1");
                return "" === r ? void 0 : r
            }
        }),
        n({
            global: !0,
            forced: !0
        }, {
            Symbol: p
        })
    }
}
, function(e, t) {
    var r;
    r = function() {
        return this
    }();
    try {
        r = r || new Function("return this")()
    } catch (e) {
        "object" == typeof window && (r = window)
    }
    e.exports = r
}
, function(e, t, r) {
    "use strict";
    var n = {}.propertyIsEnumerable
      , o = Object.getOwnPropertyDescriptor
      , i = o && !n.call({
        1: 2
    }, 1);
    t.f = i ? function(e) {
        var t = o(this, e);
        return !!t && t.enumerable
    }
    : n
}
, function(e, t, r) {
    var n = r(2)
      , o = r(46)
      , i = "".split;
    e.exports = n((function() {
        return !Object("z").propertyIsEnumerable(0)
    }
    )) ? function(e) {
        return "String" == o(e) ? i.call(e, "") : Object(e)
    }
    : Object
}
, function(e, t) {
    var r = {}.toString;
    e.exports = function(e) {
        return r.call(e).slice(8, -1)
    }
}
, function(e, t, r) {
    var n = r(0)
      , o = r(28)
      , i = n.WeakMap;
    e.exports = "function" == typeof i && /native code/.test(o(i))
}
, function(e, t, r) {
    var n = r(16)
      , o = r(50)
      , i = r(54)
      , a = r(7);
    e.exports = n("Reflect", "ownKeys") || function(e) {
        var t = o.f(a(e))
          , r = i.f;
        return r ? t.concat(r(e)) : t
    }
}
, function(e, t, r) {
    var n = r(0);
    e.exports = n
}
, function(e, t, r) {
    var n = r(33)
      , o = r(17).concat("length", "prototype");
    t.f = Object.getOwnPropertyNames || function(e) {
        return n(e, o)
    }
}
, function(e, t, r) {
    var n = r(9)
      , o = r(52)
      , i = r(53)
      , a = function(e) {
        return function(t, r, a) {
            var s, c = n(t), u = o(c.length), l = i(a, u);
            if (e && r != r) {
                for (; u > l; )
                    if ((s = c[l++]) != s)
                        return !0
            } else
                for (; u > l; l++)
                    if ((e || l in c) && c[l] === r)
                        return e || l || 0;
            return !e && -1
        }
    };
    e.exports = {
        includes: a(!0),
        indexOf: a(!1)
    }
}
, function(e, t, r) {
    var n = r(34)
      , o = Math.min;
    e.exports = function(e) {
        return e > 0 ? o(n(e), 9007199254740991) : 0
    }
}
, function(e, t, r) {
    var n = r(34)
      , o = Math.max
      , i = Math.min;
    e.exports = function(e, t) {
        var r = n(e);
        return r < 0 ? o(r + t, 0) : i(r, t)
    }
}
, function(e, t) {
    t.f = Object.getOwnPropertySymbols
}
, function(e, t, r) {
    var n = r(2)
      , o = /#|\.prototype\./
      , i = function(e, t) {
        var r = s[a(e)];
        return r == u || r != c && ("function" == typeof t ? n(t) : !!t)
    }
      , a = i.normalize = function(e) {
        return String(e).replace(o, ".").toLowerCase()
    }
      , s = i.data = {}
      , c = i.NATIVE = "N"
      , u = i.POLYFILL = "P";
    e.exports = i
}
, function(e, t, r) {
    var n = r(0)
      , o = r(57)
      , i = r(58)
      , a = r(3)
      , s = r(8)
      , c = s("iterator")
      , u = s("toStringTag")
      , l = i.values;
    for (var h in o) {
        var p = n[h]
          , f = p && p.prototype;
        if (f) {
            if (f[c] !== l)
                try {
                    a(f, c, l)
                } catch (e) {
                    f[c] = l
                }
            if (f[u] || a(f, u, h),
            o[h])
                for (var d in i)
                    if (f[d] !== i[d])
                        try {
                            a(f, d, i[d])
                        } catch (e) {
                            f[d] = i[d]
                        }
        }
    }
}
, function(e, t) {
    e.exports = {
        CSSRuleList: 0,
        CSSStyleDeclaration: 0,
        CSSValueList: 0,
        ClientRectList: 0,
        DOMRectList: 0,
        DOMStringList: 0,
        DOMTokenList: 1,
        DataTransferItemList: 0,
        FileList: 0,
        HTMLAllCollection: 0,
        HTMLCollection: 0,
        HTMLFormElement: 0,
        HTMLSelectElement: 0,
        MediaList: 0,
        MimeTypeArray: 0,
        NamedNodeMap: 0,
        NodeList: 1,
        PaintRequestList: 0,
        Plugin: 0,
        PluginArray: 0,
        SVGLengthList: 0,
        SVGNumberList: 0,
        SVGPathSegList: 0,
        SVGPointList: 0,
        SVGStringList: 0,
        SVGTransformList: 0,
        SourceBufferList: 0,
        StyleSheetList: 0,
        TextTrackCueList: 0,
        TextTrackList: 0,
        TouchList: 0
    }
}
, function(e, t, r) {
    "use strict";
    var n = r(9)
      , o = r(59)
      , i = r(18)
      , a = r(29)
      , s = r(66)
      , c = a.set
      , u = a.getterFor("Array Iterator");
    e.exports = s(Array, "Array", (function(e, t) {
        c(this, {
            type: "Array Iterator",
            target: n(e),
            index: 0,
            kind: t
        })
    }
    ), (function() {
        var e = u(this)
          , t = e.target
          , r = e.kind
          , n = e.index++;
        return !t || n >= t.length ? (e.target = void 0,
        {
            value: void 0,
            done: !0
        }) : "keys" == r ? {
            value: n,
            done: !1
        } : "values" == r ? {
            value: t[n],
            done: !1
        } : {
            value: [n, t[n]],
            done: !1
        }
    }
    ), "values"),
    i.Arguments = i.Array,
    o("keys"),
    o("values"),
    o("entries")
}
, function(e, t, r) {
    var n = r(8)
      , o = r(36)
      , i = r(6)
      , a = n("unscopables")
      , s = Array.prototype;
    null == s[a] && i.f(s, a, {
        configurable: !0,
        value: o(null)
    }),
    e.exports = function(e) {
        s[a][e] = !0
    }
}
, function(e, t, r) {
    var n, o, i = r(0), a = r(61), s = i.process, c = s && s.versions, u = c && c.v8;
    u ? o = (n = u.split("."))[0] < 4 ? 1 : n[0] + n[1] : a && (!(n = a.match(/Edge\/(\d+)/)) || n[1] >= 74) && (n = a.match(/Chrome\/(\d+)/)) && (o = n[1]),
    e.exports = o && +o
}
, function(e, t, r) {
    var n = r(16);
    e.exports = n("navigator", "userAgent") || ""
}
, function(e, t, r) {
    var n = r(35);
    e.exports = n && !Symbol.sham && "symbol" == typeof Symbol.iterator
}
, function(e, t, r) {
    var n = r(4)
      , o = r(6)
      , i = r(7)
      , a = r(64);
    e.exports = n ? Object.defineProperties : function(e, t) {
        i(e);
        for (var r, n = a(t), s = n.length, c = 0; s > c; )
            o.f(e, r = n[c++], t[r]);
        return e
    }
}
, function(e, t, r) {
    var n = r(33)
      , o = r(17);
    e.exports = Object.keys || function(e) {
        return n(e, o)
    }
}
, function(e, t, r) {
    var n = r(16);
    e.exports = n("document", "documentElement")
}
, function(e, t, r) {
    "use strict";
    var n = r(20)
      , o = r(67)
      , i = r(38)
      , a = r(69)
      , s = r(39)
      , c = r(3)
      , u = r(27)
      , l = r(8)
      , h = r(14)
      , p = r(18)
      , f = r(37)
      , d = f.IteratorPrototype
      , v = f.BUGGY_SAFARI_ITERATORS
      , m = l("iterator")
      , y = function() {
        return this
    };
    e.exports = function(e, t, r, l, f, g, x) {
        o(r, t, l);
        var b, w, C, A = function(e) {
            if (e === f && z)
                return z;
            if (!v && e in M)
                return M[e];
            switch (e) {
            case "keys":
            case "values":
            case "entries":
                return function() {
                    return new r(this,e)
                }
            }
            return function() {
                return new r(this)
            }
        }, S = t + " Iterator", j = !1, M = e.prototype, O = M[m] || M["@@iterator"] || f && M[f], z = !v && O || A(f), L = "Array" == t && M.entries || O;
        if (L && (b = i(L.call(new e)),
        d !== Object.prototype && b.next && (h || i(b) === d || (a ? a(b, d) : "function" != typeof b[m] && c(b, m, y)),
        s(b, S, !0, !0),
        h && (p[S] = y))),
        "values" == f && O && "values" !== O.name && (j = !0,
        z = function() {
            return O.call(this)
        }
        ),
        h && !x || M[m] === z || c(M, m, z),
        p[t] = z,
        f)
            if (w = {
                values: A("values"),
                keys: g ? z : A("keys"),
                entries: A("entries")
            },
            x)
                for (C in w)
                    (v || j || !(C in M)) && u(M, C, w[C]);
            else
                n({
                    target: t,
                    proto: !0,
                    forced: v || j
                }, w);
        return w
    }
}
, function(e, t, r) {
    "use strict";
    var n = r(37).IteratorPrototype
      , o = r(36)
      , i = r(10)
      , a = r(39)
      , s = r(18)
      , c = function() {
        return this
    };
    e.exports = function(e, t, r) {
        var u = t + " Iterator";
        return e.prototype = o(n, {
            next: i(1, r)
        }),
        a(e, u, !1, !0),
        s[u] = c,
        e
    }
}
, function(e, t, r) {
    var n = r(2);
    e.exports = !n((function() {
        function e() {}
        return e.prototype.constructor = null,
        Object.getPrototypeOf(new e) !== e.prototype
    }
    ))
}
, function(e, t, r) {
    var n = r(7)
      , o = r(70);
    e.exports = Object.setPrototypeOf || ("__proto__"in {} ? function() {
        var e, t = !1, r = {};
        try {
            (e = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(r, []),
            t = r instanceof Array
        } catch (e) {}
        return function(r, i) {
            return n(r),
            o(i),
            t ? e.call(r, i) : r.__proto__ = i,
            r
        }
    }() : void 0)
}
, function(e, t, r) {
    var n = r(5);
    e.exports = function(e) {
        if (!n(e) && null !== e)
            throw TypeError("Can't set " + String(e) + " as a prototype");
        return e
    }
}
, function(e, t, r) {
    "use strict";

    function n(e) {
        const t = e.split("\n")
          , r = {}
          , n = "-?\\d*(?:\\.\\d+)?"
          , reg1 = "[+-]*\\d+\\.?\\d*[Ee]*[+-]*\\d+"
          , // /^[+-]?[\d]+([\.][\d]+)?([Ee][+-]?[\d]+)?$/,
        o = new RegExp("^[ \\t]*(" + ["\\d+", "\\d+", n, n, n, reg1, "-1|\\d+"].join(")[ \\t]+(") + ")[ \\t]*$","m");
        return t.forEach(e=>{
            const t = e.match(o);
            if (t) {
                const e = parseInt(t[1], 10);
                r[e] = {
                    id: e,
                    type: parseInt(t[2], 10),
                    x: parseFloat(t[3]),
                    y: parseFloat(t[4]),
                    z: parseFloat(t[5]),
                    radius: parseFloat(t[6]),
                    parent: parseInt(t[7], 10)
                }
            }
        }
        ),
        r
    }
    r.r(t),
    r.d(t, "swcParser", (function() {
        return n
    }
    )),
    r.d(t, "default", (function() {
        return d
    }
    ));
    const o = r(19);
    r(40)(o);
    const i = r(41).default
      , a = ["uniform float particleScale;", "attribute float radius;", "attribute vec3 typeColor;", "varying vec3 vColor;", "varying vec4 mvPosition;", "varying float vRadius;", "void main() ", "{", "vColor = vec3(typeColor); // set RGB color associated to vertex; use later in fragment shader.", "mvPosition = modelViewMatrix * vec4(position, 1.0);", "// gl_PointSize = size;", "gl_PointSize = radius * ((particleScale*2.0) / length(mvPosition.z));", "gl_Position = projectionMatrix * mvPosition;", "vRadius = radius;", "}"].join("\n")
      , s = ["uniform sampler2D sphereTexture; // Imposter image of sphere", "uniform mat4 projectionMatrix;", "varying vec3 vColor; // colors associated to vertices; assigned by vertex shader", "varying vec4 mvPosition;", "varying float vRadius;", "void main() ", "{", "// what part of the sphere image?", "vec2 uv = vec2(gl_PointCoord.x, 1.0 - gl_PointCoord.y);", "vec4 sphereColors = texture2D(sphereTexture, uv);", "// avoid further computation at invisible corners", "if (sphereColors.a < 0.3) discard;", "// calculates a color for the particle", "// gl_FragColor = vec4(vColor, 1.0);", "// sets a white particle texture to desired color", "// gl_FragColor = sqrt(gl_FragColor * texture2D(sphereTexture, uv)) + vec4(0.1, 0.1, 0.1, 0.0);", "// red channel contains colorizable sphere image", "vec3 baseColor = vColor * sphereColors.r;", "// green channel contains (white?) specular highlight", "vec3 highlightColor = baseColor + sphereColors.ggg;", "gl_FragColor = vec4(highlightColor, sphereColors.a);", "// TODO blue channel contains depth offset, but we cannot use gl_FragDepth in webgl?", "#ifdef GL_EXT_frag_depth", "float far = gl_DepthRange.far; float near = gl_DepthRange.near;", "float dz = sphereColors.b * vRadius;", "vec4 clipPos = projectionMatrix * (mvPosition + vec4(0, 0, dz, 0));", "float ndc_depth = clipPos.z/clipPos.w;", "float depth = (((far-near) * ndc_depth) + near + far) / 2.0;", "gl_FragDepthEXT = depth;", "#endif", "}"].join("\n")
      , c = (["uniform sampler2D sphereTexture; // Imposter image of sphere", "uniform mat4 projectionMatrix;", "varying vec3 vColor; // colors associated to vertices; assigned by vertex shader", "varying vec4 mvPosition;", "varying float vRadius;", "void main() ", "{", "// what part of the sphere image?", "vec2 uv = vec2(gl_PointCoord.x, 1.0 - gl_PointCoord.y);", "vec4 sphereColors = texture2D(sphereTexture, uv);", "// avoid further computation at invisible corners", "if (sphereColors.a < 0.3) discard;", "// calculates a color for the particle", "// gl_FragColor = vec4(vColor, 1.0);", "// sets a white particle texture to desired color", "// gl_FragColor = sqrt(gl_FragColor * texture2D(sphereTexture, uv)) + vec4(0.1, 0.1, 0.1, 0.0);", "// red channel contains colorizable sphere image", "vec3 baseColor = vColor * sphereColors.r;", "// green channel contains (white?) specular highlight", "gl_FragColor = vec4(baseColor, sphereColors.a);", "// TODO blue channel contains depth offset, but we cannot use gl_FragDepth in webgl?", "#ifdef GL_EXT_frag_depth", "float far = gl_DepthRange.far; float near = gl_DepthRange.near;", "float dz = sphereColors.b * vRadius;", "vec4 clipPos = projectionMatrix * (mvPosition + vec4(0, 0, dz, 0));", "float ndc_depth = clipPos.z/clipPos.w;", "float depth = (((far-near) * ndc_depth) + near + far) / 2.0;", "gl_FragDepthEXT = depth;", "#endif", "}"].join("\n"),
    ["attribute float radius;", "attribute vec3 typeColor;", "varying vec3 vColor;", "varying vec2 sphereUv;", "varying vec4 mvPosition;", "varying float depthScale;", "void main() ", "{", "\t// TODO - offset cone position for different sphere sizes", "\t// TODO - implement depth buffer on Chrome", "\tmvPosition = modelViewMatrix * vec4(position, 1.0);", "\t// Expand quadrilateral perpendicular to both view/screen direction and cone axis", "\tvec3 cylAxis = (modelViewMatrix * vec4(normal, 0.0)).xyz; // convert cone axis to camera space", "\tvec3 sideDir = normalize(cross(vec3(0.0,0.0,-1.0), cylAxis));", "\tmvPosition += vec4(radius * sideDir, 0.0);", "\tgl_Position = projectionMatrix * mvPosition;", "\t// Pass and interpolate color", "\tvColor = typeColor;", "\t// Texture coordinates", "\tsphereUv = uv - vec2(0.5, 0.5); // map from [0,1] range to [-.5,.5], before rotation", '\t// If sideDir is "up" on screen, make sure u is positive', "\tfloat q = sideDir.y * sphereUv.y;", "\tsphereUv.y = sign(q) * sphereUv.y;", "\t// rotate texture coordinates to match cone orientation about z", "\tfloat angle = atan(sideDir.x/sideDir.y);", "\tfloat c = cos(angle);", "\tfloat s = sin(angle);", "\tmat2 rotMat = mat2(", "\t\tc, -s, ", "\t\ts,  c);", "\tsphereUv = rotMat * sphereUv;", "\tsphereUv += vec2(0.5, 0.5); // map back from [-.5,.5] => [0,1]", "\t// We are painting an angled cone onto a flat quad, so depth correction is complicated", "   float foreshortening = length(cylAxis) / length(cylAxis.xy); // correct depth for foreshortening", "   // foreshortening limit is a tradeoff between overextruded cone artifacts, and depth artifacts", "   if (foreshortening > 4.0) foreshortening = 0.9; // hack to not pop out at extreme angles...", "   depthScale = radius * foreshortening; // correct depth for foreshortening", "}"].join("\n"))
      , u = ["uniform sampler2D sphereTexture; // Imposter image of sphere", "uniform mat4 projectionMatrix;", "varying vec3 vColor;", "varying vec2 sphereUv;", "varying vec4 mvPosition;", "varying float depthScale;", "void main() ", "{", "\tvec4 sphereColors = texture2D(sphereTexture, sphereUv);", "\tif (sphereColors.a < 0.3) discard;", "\tvec3 baseColor = vColor * sphereColors.r;", "\tvec3 highlightColor = baseColor + sphereColors.ggg;", "\tgl_FragColor = vec4(highlightColor, sphereColors.a);", "#ifdef GL_EXT_frag_depth", "float dz = sphereColors.b * depthScale;", "vec4 mvp = mvPosition + vec4(0, 0, dz, 0);", "vec4 clipPos = projectionMatrix * mvp;", "float ndc_depth = clipPos.z/clipPos.w;", "float far = gl_DepthRange.far; float near = gl_DepthRange.near;", "float depth = (((far-near) * ndc_depth) + near + far) / 2.0;", "gl_FragDepthEXT = depth;", "#endif", "}"].join("\n");

    function l(e) {
        const t = {
            xmin: 1 / 0,
            xmax: -1 / 0,
            ymin: 1 / 0,
            ymax: -1 / 0,
            zmin: 1 / 0,
            zmax: -1 / 0
        };
        return Object.values(e).forEach(e=>{
            const r = e.radius;
            e.x - r < t.xmin && (t.xmin = e.x - r),
            e.x + r > t.xmax && (t.xmax = e.x + r),
            e.y - r < t.ymin && (t.ymin = e.y - r),
            e.y + r > t.ymax && (t.ymax = e.y + r),
            e.z - r < t.zmin && (t.zmin = e.z - r),
            e.z + r > t.zmax && (t.zmax = e.z + r)
        }
        ),
        t
    }

    function h(e, t) {
        const r = (t.xmax - t.xmin) / 2
          , n = (t.ymax - t.ymin) / 2
          , i = (t.zmax - t.zmin) / 2;
        let a = Math.min(r, n, i)
          , s = new o.Vector3(t.xmin + r,t.ymin + n,t.zmin + i)
          , c = a * a;
        return Object.values(e).forEach(e=>{
            const t = new o.Vector3(e.x,e.y,e.z)
              , r = new o.Vector3;
            r.subVectors(s, t);
            const n = r.dot(r);
            if (n + e.radius * e.radius > c) {
                const o = Math.sqrt(n)
                  , i = (a + (o + e.radius)) / 2
                  , u = r.clone().divideScalar(o).clone().multiplyScalar(i - e.radius);
                s = t.clone().add(u),
                a = i,
                c = a * a
            }
        }
        ),
        {
            center: s,
            radius: a
        }
    }

    function p(e, t, r, n) {
        const i = e * (Math.PI / 180) / 2
          , a = t.radius / Math.sin(i)
          , {center: s} = t
          , c = Math.max(-n / 2, r ? s.z - a : s.z + a);
        return new o.Vector3(s.x,s.y,c)
    }

    function f(e, t) {
        return e.traverse(e=>{
            e.material = new o.ShaderMaterial({
                uniforms: {
                    color: {
                        type: "c",
                        value: new o.Color("" + t)
                    }
                },
                vertexShader: "\n        #line 585\n        varying vec3 normal_in_camera;\n        varying vec3 view_direction;\n\n        void main() {\n          vec4 pos_in_camera = modelViewMatrix * vec4(position, 1.0);\n          gl_Position = projectionMatrix * pos_in_camera;\n          normal_in_camera = normalize(mat3(modelViewMatrix) * normal);\n          view_direction = normalize(pos_in_camera.xyz);\n        }\n      ",
                fragmentShader: "\n        #line 597\n        uniform vec3 color;\n        varying vec3 normal_in_camera;\n        varying vec3 view_direction;\n\n        void main() {\n          // Make edges more opaque than center\n          float edginess = 1.0 - abs(dot(normal_in_camera, view_direction));\n          float opacity = clamp(edginess - 0.30, 0.0, 0.5);\n          // Darken compartment at the very edge\n          float blackness = pow(edginess, 4.0) - 0.3;\n          vec3 c = mix(color, vec3(0,0,0), blackness);\n          gl_FragColor = vec4(c, opacity);\n    }\n      ",
                transparent: !0,
                depthTest: !0,
                depthWrite: !1,
                side: o.DoubleSide
            })
        }
        ),
        e
    }
        function f0(e, t) {
        return e.traverse(e=>{
            e.material = new o.ShaderMaterial({
                uniforms: {
                    color: {
                        type: "c",
                        value: new o.Color("" + t)
                    }
                },
                vertexShader: "varying vec3 normal_in_camera;   varying vec3 tnorm;varying vec3 light;     varying vec3 view_direction;        void main() {  light = normalize( vec4(0.0, 0.0, 1.0,1.0)).xyz;        vec4 pos_in_camera = modelViewMatrix * vec4(position, 1.0);          gl_Position = projectionMatrix * pos_in_camera;          normal_in_camera = normalize(mat3(modelViewMatrix) * normal);view_direction = normalize(pos_in_camera.xyz); tnorm=normal_in_camera;}",
                fragmentShader: "uniform vec3 color;     varying vec3 tnorm;varying vec3 light;     varying vec3 normal_in_camera; varying vec3 view_direction;        void main() {   float diffuse = float(max((dot((light), (tnorm.xyz))), 0.0)*0.6);   gl_FragColor = vec4(diffuse, diffuse, diffuse, 0.2) + vec4(color*0.6,0.1);   }",
                transparent: !0,
                depthTest: !0,
                depthWrite: !1,
                side: o.SingleSide
            })
        }
        ),
        e
    }
    class d {
        constructor(e) {
            this.swc = null,
            this.mode = "particle",
            this.flip = !1,
            this.colors = [3276764, 7163891, 11156208, 15958066, 5897248, 16307260, 16591949, 13224393],
            this.radius_scale_factor = 1,
            this.metadata = !1,
            this.on_select_node = null,
            this.on_toggle_node = null,
            this.show_stats = !1,
            this.animated = 1,
            this.three = o,
            this.showAxes = !1,
            this.show_cones = !0,
            this.brainboundingbox = null,
            this.last_anim_timestamp = null,
            this.mouseHandler = null,
            this.nodeParticleTexture = "",
            this.min_radius = null,
            this.max_radius = 1,
            this.raycaster = new o.Raycaster,
            this.trackControls = null,
            this.backgroundColor = 16777215,
            this.renderer = null,
            this.camera = null,
            this.cameraChangeCallback = null,
            this.onTop = !1,
            this.maxVolumeSize = 1e5,
            this.setValues(e),
            "object" == typeof e.dom_element ? this.dom_element = e.dom_element : this.dom_element = document.getElementById(e.dom_element || "container"),
            this.HEIGHT = this.dom_element.clientHeight,
            this.WIDTH = this.dom_element.clientWidth
        }
        setValues(e) {
            void 0 !== e && Object.keys(e).forEach(t=>{
                const r = e[t];
                void 0 !== r && t in this && (this[t] = r)
            }
            )
        }
        nodeColor(e) {
            return e.type < this.three_colors.length ? this.three_colors[e.type] : this.three_colors[0]
        }
        generateSphere(e) {
            const t = this.three_materials[e.type]
              , r = e.radius || .01
              , n = new o.SphereGeometry(r)
              , i = new o.Mesh(n,t);
            return i.position.x = e.x,
            i.position.y = e.y,
            i.position.z = e.z,
            i
        }
        generateConeGeometry(e, t) {
            const r = this.three_materials[t.type]
              , n = new o.Vector3(e.x,e.y,e.z)
              , i = new o.Vector3(t.x,t.y,t.z)
              , a = n.distanceTo(i)
              , s = (new o.Vector3).subVectors(n, i);
            s.normalize();
            const c = Math.acos(s.y)
              , u = new o.Vector3;
            u.crossVectors(s, new o.Vector3(0,1,0)),
            u.normalize();
            const l = e.radius || .01
              , h = t.radius || .01
              , p = new o.CylinderGeometry(l,h,a)
              , f = new o.Mesh(p,r);
            f.matrixAutoUpdate = !1,
            f.matrix.makeRotationAxis(u, -c);
            const d = new o.Vector3((e.x + t.x) / 2,(e.y + t.y) / 2,(e.z + t.z) / 2);
            return f.matrix.setPosition(d),
            f
        }
        generateCone(e, t, r) {
            const n = {}
              , i = {};
            let a = this.nodeColor(e);
            r && (a = new o.Color(r)),
            n.vertex = new o.Vector3(e.x,e.y,e.z),
            n.radius = e.radius,
            n.color = a;
            let s = this.nodeColor(t);
            r && (s = new o.Color(r)),
            i.vertex = new o.Vector3(t.x,t.y,t.z),
            i.radius = t.radius,
            i.color = s;
            const c = (new o.Vector3).subVectors(i.vertex, n.vertex)
              , u = c.clone().negate();
            return {
                child: n,
                parent: i,
                normal1: c,
                normal2: u
            }
        }
        createNeuron(e, t) {
            const r = new o.Object3D;
            let n, i;
            let col=new o.Color(t);
            if ("particle" === this.mode) {
                const l = document.createElement("img")
                  , h = new o.Texture(l);
                l.onload = function() {
                    h.needsUpdate = !0
                }
                ,
                l.src = this.nodeParticleTexture,
                n = new o.BufferGeometry;
                const p = .5 * this.HEIGHT / this.renderer.getPixelRatio() / Math.tan(.5 * this.fov * Math.PI / 180)
                  , f = {
                    radius: {
                        type: "fv1",
                        value: []
                    },
                    typeColor: {
                        type: "c",
                        value: []
                    },
                    vertices: {
                        type: "f",
                        value: []
                    }
                }
                  , d = {
                    particleScale: {
                        type: "f",
                        value: p
                    },
                    sphereTexture: {
                        type: "t",
                        value: h
                    }
                }
                  , v = {};
                Object.keys(e).forEach(r=>{
                    let n = this.nodeColor(e[r]);
                    t && (n = new o.Color(t));
                    const i = function(e) {
                        return new o.Vector3(e.x,e.y,e.z)
                    }(e[r]);
                    let a = e[r].radius * this.radius_scale_factor;
                    this.min_radius && a < this.min_radius && (a = this.min_radius),
                    this.max_radius && a > this.max_radius && (a = this.max_radius),
                    f.radius.value.push(a),
                    f.typeColor.value.push(n.r),
                    f.typeColor.value.push(n.g),
                    f.typeColor.value.push(n.b),
                    f.vertices.value.push(i.x),
                    f.vertices.value.push(i.y),
                    f.vertices.value.push(i.z),
                    v[f.radius.value.length - 1] = e[r].sampleNumber
                }
                ),
                n.setAttribute("position", new o.Float32BufferAttribute(f.vertices.value,3)),
                n.setAttribute("radius", new o.Float32BufferAttribute(f.radius.value,1)),
                n.setAttribute("typeColor", new o.Float32BufferAttribute(f.typeColor.value,3)),
                i = new o.ShaderMaterial({
                    uniforms: d,
                    vertexShader: a,
                    fragmentShader: s,
                    transparent: !0
                }),
                i.extensions.fragDepth = !0;
                let m = null;
                const y = new o.Points(n,i);
                if (y.userData = {
                    indexLookup: v,
                    materialShader: m
                },
                i.onBeforeCompile = e=>{
                    e.uniforms.alpha = {
                        value: 0
                    },
                    e.vertexShader = "uniform float alpha;\n" + e.vertexShader,
                    e.vertexShader = e.vertexShader.replace("#include <begin_vertex>", ["vAlpha = alpha"].join("\n")),
                    m = e,
                    m.uniforms.alpha.value = .9,
                    y.userData.materialShader = m
                }
                ,
                r.add(y),
                this.show_cones) {
                    const n = {
                        radius: {
                            type: "fv1",
                            value: []
                        },
                        indices: {
                            type: "iv1",
                            value: []
                        },
                        typeColor: {
                            type: "c",
                            value: []
                        },
                        vertices: {
                            type: "f",
                            value: []
                        },
                        normals: {
                            type: "f",
                            value: []
                        },
                        uv: {
                            type: "f",
                            value: []
                        }
                    }
                      , i = {
                        sphereTexture: {
                            type: "t",
                            value: h
                        }
                    }
                      , a = [new o.Vector2(.5,0), new o.Vector2(.5,1), new o.Vector2(.5,1)]
                      , s = new o.BufferGeometry;
                    let l = 0;
                    Object.keys(e).forEach(r=>{
                        if (-1 !== e[r].parent) {
                            const i = this.generateCone(e[r], e[e[r].parent], t);
                            let s = i.child.color;
                            t && (s = new o.Color(t));
                            let c = i.parent.radius * this.radius_scale_factor;
                            this.min_radius && c < this.min_radius && (c = this.min_radius);
                            this.max_radius && c > this.max_radius && (c = this.max_radius);
                            let u = i.child.radius * this.radius_scale_factor;
                            this.min_radius && u < this.min_radius && (u = this.min_radius),
                            this.max_radius && u > this.max_radius && (u = this.max_radius),
                            n.vertices.value.push(i.child.vertex.x),
                            n.vertices.value.push(i.child.vertex.y),
                            n.vertices.value.push(i.child.vertex.z),
                            n.radius.value.push(u),
                            n.typeColor.value.push(s.r),
                            n.typeColor.value.push(s.g),
                            n.typeColor.value.push(s.b),
                            n.normals.value.push(i.normal1.x),
                            n.normals.value.push(i.normal1.y),
                            n.normals.value.push(i.normal1.z),
                            n.uv.value.push(a[0].x),
                            n.uv.value.push(a[0].y),
                            n.indices.value.push(l),
                            l += 1,
                            n.vertices.value.push(i.child.vertex.x),
                            n.vertices.value.push(i.child.vertex.y),
                            n.vertices.value.push(i.child.vertex.z),
                            n.radius.value.push(u),
                            n.typeColor.value.push(s.r),
                            n.typeColor.value.push(s.g),
                            n.typeColor.value.push(s.b),
                            n.normals.value.push(i.normal2.x),
                            n.normals.value.push(i.normal2.y),
                            n.normals.value.push(i.normal2.z),
                            n.uv.value.push(a[1].x),
                            n.uv.value.push(a[1].y),
                            n.indices.value.push(l),
                            l += 1,
                            n.vertices.value.push(i.parent.vertex.x),
                            n.vertices.value.push(i.parent.vertex.y),
                            n.vertices.value.push(i.parent.vertex.z),
                            n.radius.value.push(c),
                            n.typeColor.value.push(s.r),
                            n.typeColor.value.push(s.g),
                            n.typeColor.value.push(s.b),
                            n.normals.value.push(i.normal2.x),
                            n.normals.value.push(i.normal2.y),
                            n.normals.value.push(i.normal2.z),
                            n.uv.value.push(a[2].x),
                            n.uv.value.push(a[2].y),
                            n.indices.value.push(l),
                            l += 1,
                            s = i.parent.color,
                            t && (s = new o.Color(t)),
                            n.vertices.value.push(i.parent.vertex.x),
                            n.vertices.value.push(i.parent.vertex.y),
                            n.vertices.value.push(i.parent.vertex.z),
                            n.radius.value.push(c),
                            n.typeColor.value.push(s.r),
                            n.typeColor.value.push(s.g),
                            n.typeColor.value.push(s.b),
                            n.normals.value.push(i.normal1.x),
                            n.normals.value.push(i.normal1.y),
                            n.normals.value.push(i.normal1.z),
                            n.uv.value.push(a[0].x),
                            n.uv.value.push(a[0].y),
                            n.indices.value.push(l),
                            l += 1,
                            n.vertices.value.push(i.parent.vertex.x),
                            n.vertices.value.push(i.parent.vertex.y),
                            n.vertices.value.push(i.parent.vertex.z),
                            n.radius.value.push(c),
                            n.typeColor.value.push(s.r),
                            n.typeColor.value.push(s.g),
                            n.typeColor.value.push(s.b),
                            n.normals.value.push(i.normal2.x),
                            n.normals.value.push(i.normal2.y),
                            n.normals.value.push(i.normal2.z),
                            n.uv.value.push(a[1].x),
                            n.uv.value.push(a[1].y),
                            n.indices.value.push(l),
                            l += 1,
                            n.vertices.value.push(i.child.vertex.x),
                            n.vertices.value.push(i.child.vertex.y),
                            n.vertices.value.push(i.child.vertex.z),
                            n.radius.value.push(u),
                            n.typeColor.value.push(s.r),
                            n.typeColor.value.push(s.g),
                            n.typeColor.value.push(s.b),
                            n.normals.value.push(i.normal1.x),
                            n.normals.value.push(i.normal1.y),
                            n.normals.value.push(i.normal1.z),
                            n.uv.value.push(a[2].x),
                            n.uv.value.push(a[2].y),
                            n.indices.value.push(l),
                            l += 1
                        }
                    }
                    ),
                    s.setIndex(new o.Uint32BufferAttribute(n.indices.value,1)),
                    s.setAttribute("position", new o.Float32BufferAttribute(n.vertices.value,3)),
                    s.setAttribute("radius", new o.Float32BufferAttribute(n.radius.value,1)),
                    s.setAttribute("typeColor", new o.Float32BufferAttribute(n.typeColor.value,3)),
                    s.setAttribute("normal", new o.Float32BufferAttribute(n.normals.value,3)),
                    s.setAttribute("uv", new o.Float32BufferAttribute(n.uv.value,2));
                    const p = new o.ShaderMaterial({
                        uniforms: i,
                        vertexShader: c,
                        fragmentShader: u,
                        transparent: !0,
                        depthTest: !0,
                        side: o.DoubleSide,
                        alphaTest: .5
                    });
                    p.extensions.fragDepth = !0;
                    const f = new o.Mesh(s,p);
                    p.onBeforeCompile = e=>{
                        e.uniforms.alpha = {
                            value: 0
                        },
                        e.vertexShader = "uniform float alpha;\n" + e.vertexShader,
                        e.vertexShader = e.vertexShader.replace("#include <begin_vertex>", ["vAlpha = alpha"].join("\n")),
                        m = e,
                        m.uniforms.alpha.value = .9,
                        f.userData = {
                            materialShader: m
                        }
                    }
                    ,
                    r.add(f)
                }
            } else
                "sphere" === this.mode && Object.keys(e).forEach(t=>{
                    const n = this.generateSphere(e[t]);
                    if (r.add(n),
                    this.show_cones && -1 !== e[t].parent) {
                        const n = this.generateConeGeometry(e[t], e[e[t].parent]);
                        r.add(n)
                    }
                }
                );
            if ("skeleton" === this.mode || !1 === this.show_cones) {
                // i = new o.LineBasicMaterial({ color: Math.random() * 0xffffff });
                var uniforms1 = {
                    select: { value: 0 },
                    selectcount:{value:0},
                    color:{value:col}
                };
 
                var params = uniforms1;
                i = new o.ShaderMaterial({
                    uniforms: params,
                    vertexShader: " void main(){vec4 pos_in_camera = modelViewMatrix * vec4(position, 1.0);gl_Position = projectionMatrix * pos_in_camera;}",
                    fragmentShader: "uniform float select;uniform float selectcount; uniform vec3 color;void main(){gl_FragColor =vec4(color,1.0);if(selectcount>0.0){gl_FragColor =vec4(color*0.5,1.0);if(select>0.0)gl_FragColor =vec4(1.0,1.0,1.0,1.0);} }",
                    transparent: !0
                }),


                // "skeleton" === this.mode && i.color.set(col),
                n = new o.BufferGeometry;
                let vertex =[];
                let color =[];
                Object.keys(e).forEach(t=>{

                    if (-1 !== e[t].parent) {
                        const r = function(e, t) {
                            return {
                                child: new o.Vector3(e.x,e.y,e.z),
                                parent: new o.Vector3(t.x,t.y,t.z)
                            }
                        }(e[t], e[e[t].parent]);
                        vertex.push(r.child.x),
                        vertex.push(r.child.y),
                        vertex.push(r.child.z),
                        vertex.push(r.parent.x),
                        vertex.push(r.parent.y),
                        vertex.push(r.parent.z)
                    }
                }
                );
                n.setAttribute("position",new o.Float32BufferAttribute(vertex,3))

                const t = new o.LineSegments(n,i);
                r.add(t)
            }
            return r
        }
        addAxes() {
            const e = new o.WebGLRenderer({
                alpha: !0
            });
            e.setClearColor(0, 0),
            e.setSize(200, 200),
            this.axesRenderer = e;
            const t = this.dom_element.appendChild(e.domElement);
            t.setAttribute("id", "axesCanvas"),
            t.style.width = 200,
            t.style.height = 200,
            t.style.position = "absolute",
            t.style.zIndex = 200,
            t.style.bottom = "5px",
            t.style.right = "5px";
            const r = new o.PerspectiveCamera(50,1,1,1e4);
            r.up = this.camera.up,
            this.axesCamera = r;
            const n = new o.Scene
              , i = new o.Vector3(0,0,0);
            n.add(new o.ArrowHelper(new o.Vector3(1,0,0),i,60,16711680,20,10)),
            n.add(new o.ArrowHelper(new o.Vector3(0,1,0),i,60,65280,20,10)),
            n.add(new o.ArrowHelper(new o.Vector3(0,0,1),i,60,255,20,10)),
            this.axesScene = n
        }
        init() {
            "noeffect" === this.effect && (this.effect = !1),
            this.three_colors = [],
            Object.keys(this.colors).forEach(e=>{
                this.three_colors.push(new o.Color(this.colors[e]))
            }
            ),
            this.three_materials = [],
            Object.keys(this.colors).forEach(e=>{
                this.three_materials.push(new o.MeshBasicMaterial({
                    color: this.colors[e],
                    wireframe: !1
                }))
            }
            ),
            this.renderer = new o.WebGL1Renderer({
                antialias: !0
            }),
            this.renderer.setClearColor(this.backgroundColor, 1),
            this.renderer.setSize(this.WIDTH, this.HEIGHT),
            this.dom_element.appendChild(this.renderer.domElement),
            this.renderer.autoClear = !1,
            this.scene = new o.Scene,
            this.fov = 45;
            const e = this.maxVolumeSize
              , t = 2 * e;
            if (this.camera = new o.PerspectiveCamera(this.fov,this.WIDTH / this.HEIGHT,10,t),
            this.camera.position.z = e,
            this.showAxes && this.addAxes(),
            !0 === this.flip && this.camera.up.setY(-1),
            this.swc) {
                const e = this.createNeuron(this.swc)
                  , t = l(this.swc)
                  , r = h(this.swc, t);
                e.isNeuron = !0,
                e.boundingSphere = r,
                this.scene.add(e)
            }
            if (this.sceneOnTopable = new o.Scene,
            this.metadata) {
                const e = function(e, t) {
                    const r = document.createElement("div");
                    r.id = "node_key",
                    r.style.position = "absolute",
                    r.style.top = "0px",
                    r.style.right = "10px",
                    r.style.border = "solid 1px #aaaaaa",
                    r.style.borderRadius = "5px",
                    r.style.padding = "2px";
                    let n = "";
                    return e.forEach(e=>{
                        const r = parseInt(e.type, 10)
                          , o = r < t.length ? t[r] : t[0];
                        let i = o;
                        "string" != typeof o && (i = function(e) {
                            let t = "#000000";
                            return e >= 0 && e <= 15 ? t = "#00000" + e.toString(16) : e >= 16 && e <= 255 ? t = "#0000" + e.toString(16) : e >= 256 && e <= 4095 ? t = "#000" + e.toString(16) : e >= 4096 && e <= 65535 ? t = "#00" + e.toString(16) : e >= 65536 && e <= 1048575 ? t = "#0" + e.toString(16) : e >= 1048576 && e <= 16777215 && (t = "#" + e.toString(16)),
                            t
                        }(o)),
                        n += `<div><span style='height:10px;width:10px;background:${i};`,
                        n += `display:inline-block;'></span> : ${e.label}</div>`
                    }
                    ),
                    r.innerHTML = n,
                    r
                }(this.metadata, this.colors);
                this.dom_element.appendChild(e)
            }
            this.trackControls = new i(this.camera,this.dom_element),
            this.trackControls.maxDistance = e,
            this.trackControls.minDistance = 15,
            this.trackControls.addEventListener("change", this.render.bind(this)),
            this.trackControls.addEventListener("change", ()=>{
                if (this.cameraChangeCallback) {
                    const {position: e} = this.camera;
                    this.cameraChangeCallback({
                        x: e.x,
                        y: e.y,
                        z: e.z
                    })
                }
            }
            ),
            this.raycaster.params.Points.threshold = 50,
            this.dom_element.addEventListener("click", this.onClick.bind(this), !0)
        }
        cameraCoords() {
            const {position: e} = this.camera;
            return {
                x: e.x,
                y: e.y,
                z: e.z
            }
        }
        cameraTarget() {
            const {target: e} = this.trackControls;
            return {
                x: e.x,
                y: e.y,
                z: e.z
            }
        }
        resetView() {
            this.trackControls.reset(),
            this.trackControls.update(),
            this.camera.up.set(0, 1, 0)
        }
        restoreView(e=0, t=0, r=0, n) {
            this.trackControls.object.position.set(e, t, r),
            n && this.trackControls.target.set(n.x, n.y, n.z),
            this.trackControls.update()
        }
        resetAroundFirstNeuron({frontToBack: e}={
            frontToBack: !0
        }) {
            const t = this.scene.children.filter(e=>e.isNeuron);
            if (t.length > 0) {
                const r = t[0].boundingSphere.center
                  , n = p(this.fov, t[0].boundingSphere, e, this.maxVolumeSize);
                this.trackControls.update(),
                this.trackControls.target.set(r.x, r.y, r.z),
                this.camera.position.set(n.x, n.y, n.z),
                this.camera.up.set(0, 1, 0)
            }
        }
        onClick(e) {
            const t = this.dom_element.getBoundingClientRect()
              , r = new o.Vector2;
            r.x = (e.clientX - t.left) / this.WIDTH * 2 - 1,
            r.y = -(e.clientY - t.top) / this.HEIGHT * 2 + 1,
            this.raycaster.params.Line.threshold = 60.0;

            this.raycaster.setFromCamera(r, this.camera);
            const n = this.raycaster.intersectObjects([].concat(this.scene.children, this.sceneOnTopable.children), !0);
            var b=n.filter(e=>"LineSegments" === e.object.type);
            console.log(this.trackControls.clicked);
            if(this.trackControls.clicked){
                if(b.length>0){
                    this.on_select_node(b[0].object.parent.name,b[0],r)
                }
                else{
                    for (var i = this.scene.children.length - 1; i >= 0; i--) {
                    if (this.scene.children[i].isNeuron) {
                        this.scene.children[i].children[0].material.uniforms.selectcount = { value: 0 };
                      }
                    }
                    this.trackControls.update()
                  }
            }
            
            // if (n.length > 0) {
            //     const t = b[0];
            //     if (e.altKey) {
            //         if (this.on_toggle_node) {
            //             const e = t.object.userData.indexLookup[t.index]
            //               , r = t.object.parent.name;
            //             this.on_toggle_node(r, e)
            //         }
            //     } else if (e.shiftKey && this.trackControls.clicked && (this.trackControls.target = b[0].point),
            //     this.on_select_node) {
            //         console.log(t.object.parent.name);
            //         // const r = t.object.userData.indexLookup[t.index]
            //         //   , o = t.object.parent.name;
            //         // this.on_select_node(o, r, e, n[0].point)
            //     }
            // }

            // const t = this.dom_element.getBoundingClientRect()
            //   , r = new o.Vector2;
            // r.x = (e.clientX - t.left) / this.WIDTH * 2 - 1,
            // r.y = -(e.clientY - t.top) / this.HEIGHT * 2 + 1,
            // this.raycaster.setFromCamera(r, this.camera);
            // const n = this.raycaster.intersectObjects([].concat(this.scene.children, this.sceneOnTopable.children), !0).filter(e=>"Points" === e.object.type).filter(e=>e.object.userData.materialShader.uniforms.alpha.value > 0).sort((e,t)=>e.distanceToRay === t.distanceToRay ? e.distance - t.distance : e.distanceToRay - t.distanceToRay);
            // if (n.length > 0) {
            //     const t = n[0];
            //     if (e.altKey) {
            //         if (this.on_toggle_node) {
            //             const e = t.object.userData.indexLookup[t.index]
            //               , r = t.object.parent.name;
            //             this.on_toggle_node(r, e)
            //         }
            //     } else if (e.shiftKey && this.trackControls.clicked && (this.trackControls.target = n[0].point),
            //     this.on_select_node) {
            //         const r = t.object.userData.indexLookup[t.index]
            //           , o = t.object.parent.name;
            //         this.on_select_node(o, r, e, n[0].point)
            //     }
            // }
        }
        animate(e=null) {
            this.last_anim_timestamp ? e - this.last_anim_timestamp > 50 && (this.last_anim_timestamp = e,
            this.animated && this.render(),
            this.trackControls.update(),
            this.showAxes && (this.axesCamera.position.copy(this.camera.position),
            this.axesCamera.position.sub(this.trackControls.target),
            this.axesCamera.position.setLength(300),
            this.axesCamera.lookAt(this.axesScene.position))) : (this.last_anim_timestamp = e,
            this.animated && this.render()),
            window.requestAnimationFrame(this.animate.bind(this))
        }
        render() {
            this.renderer.clear(),
            this.renderer.render(this.scene, this.camera),
            this.onTop && this.renderer.clearDepth(),
            this.renderer.render(this.sceneOnTopable, this.camera),
            this.showAxes && this.axesRenderer.render(this.axesScene, this.axesCamera),
            this.showAxes && (this.axesCamera.position.copy(this.camera.position),
                this.axesCamera.position.sub(this.trackControls.target),
                this.axesCamera.position.setLength(300),
                this.axesCamera.lookAt(this.axesScene.position));
        }
        clear(){
            this.renderer.clear(),
            this.scene = new o.Scene;
        }
        loadNeuron(e, t, r, n=!0, o=!1, i=!1) {
            const a = this.createNeuron(r, t)
              , s = h(r, l(r))
              , c = s.center
              , u = p(this.fov, s, i, this.maxVolumeSize);
            n && (this.trackControls.update()
            // this.trackControls.target.set(c.x, c.y, c.z),
            // this.camera.position.set(u.x, u.y, u.z)
            ),
            a.name = e,
            a.isNeuron = !0,
            a.boundingSphere = s;
            (o ? this.sceneOnTopable : this.scene).add(a)
        }
        neuronLoaded(e, t=!1) {
            return void 0 !== (t ? this.sceneOnTopable : this.scene).getObjectByName(e)
        }
        unloadNeuron(e, t=!1) {
            const r = t ? this.sceneOnTopable : this.scene
              , n = r.getObjectByName(e);
            r.remove(n)
        }
        setNeuronVisible(e, t, r=!1) {
            const n = (r ? this.sceneOnTopable : this.scene).getObjectByName(e);
            n && (n.visible = t)
        }
        setNeuronDisplayLevel(e, t) {
            if ("particle" !== this.mode) {
                const r = this.scene.getObjectByName(e);
                r && r.children.forEach(e=>{
                    e.userData.materialShader && (e.userData.materialShader.uniforms.alpha.value = t)
                }
                )
            }
        }
        loadCompartment0(e, t, r, n=!0) {
            let i = (new o.OBJLoader).parse(r);
            i = f0(i, t),
            i.name = e,
            this.scene.add(i),
            // n && this.centerCameraAroundCompartment(i),
            this.trackControls.update(),
            this.render()
        }
        loadCompartment(e, t, r, n=!0) {
            let i = (new o.OBJLoader).parse(r);
            i = f(i, t),
            i.name = e,
            this.scene.add(i),
            // n && this.centerCameraAroundCompartment(i),
            this.trackControls.update(),
            this.render()
        }
        loadCompartmentFromURL(e, t, r, n=!0) {
            (new o.OBJLoader).load(r, r=>{
                if (!this.scene.getObjectByName(e)) {
                    const o = f(r, t);
                    o.name = e,
                    this.scene.add(r),
                    n && this.centerCameraAroundCompartment(o)
                }
            }
            )
        }
        compartmentLoaded(e) {
            return void 0 !== this.scene.getObjectByName(e)
        }
        centerCameraAroundCompartment(e) {
            const t = (new o.Box3).setFromObject(e);
            // this.camera.position.set(t.min.x - 10, t.min.y - 10, t.min.z - 10),
            const r = t.getCenter();
            // this.camera.lookAt.set(r.x, r.y, r.z);
            this.camera.position.set(r.x, r.y-t.getSize().y*3, r.z);
            this.camera.up.set(-1,0,0);
            // this.trackControls.update();
            
            this.trackControls.target = r,
            this.render()
        }
        unloadCompartment(e) {
            const t = this.scene.getObjectByName(e);
            this.scene.remove(t)
        }
        setCompartmentVisible(e, t) {
            const r = this.scene.getObjectByName(e);
            r && (r.visible = t)
        }
        setSize(e, t) {
            this.camera.aspect = e / t,
            this.camera.updateProjectionMatrix(),
            this.renderer.setSize(e, t),
            this.HEIGHT = t,
            this.WIDTH = e
        }
        setBackground(e) {
            this.backgroundColor = e,
            this.renderer.setClearColor(this.backgroundColor, 1)
        }
        addSoma(e){
            var  t = this.three_materials[1]
            var n = new o.SphereGeometry(20)
            var i = new o.Mesh(n,t);
            i.position.x = e.somax,
            i.position.y = e.somay,
            i.position.z = e.somaz,
            this.scene.add(i)
        }
    }
}
]);
///# sourceMappingURL=shark_viewer.js.map
